<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%>
<% topic = grab_attributes(pwd)['topic'] -%>
describe google_pubsub_topics(project: <%= gcp_project_id -%>) do
  it { should exist }
  its('names') { should include <%= doc_generation ? "'#{topic['name']}'" : "topic['name']" -%> }
  its('count') { should be >=1 }
end

describe.one do
  google_pubsub_topics(project: <%= gcp_project_id -%>).names.each do |topic_name|
    describe google_pubsub_topic(project: <%= gcp_project_id -%>, name: topic_name) do
      it { should exist }
    end
  end
end